<%@page import="news.entity.Topic"%>
<%@page import="news.entity.User"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'topic.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <%
        User user=(User)session.getAttribute("user");
        out.print("<h4>欢迎您，"+user.getUname()+"</h4><br/>");
       List<Topic> list=(List<Topic>)session.getAttribute("topiclist");
       %>
       <form action="update" method="post">
       选择要删除的主题：<select name="del">
       <%
       for(Topic t:list){
           %><option value="<%=t.getTid()%>" ><%=t.getTname()%></option>
      <% }
     %>
            </select>
      <input type="submit" value="删除"/><br/>
     
       </form>
     
    <form action="update" method="post">
     增加的主题名：<input type="text" name="add"/><br/>
      <input type="submit" value="添加主题"/>
    </form>
       
          <form action="update" method="post">
         <span>选择要修改的主题：</span><select name="update">
       <%
       for(Topic t:list){
           %>
           <option value="<%=t.getTid()%>" ><%=t.getTname()%></option>
      <%}%>
            </select>
          <br/> 修改后主题名：<input type="text" name="updatetopic"/>
            <input type="submit" value="修改主题"/>
      </form>
  </body>
</html>
